﻿@page
@model OpenPms.Areas.M.Pages.Setup.RoomType.EditModel

@{
    ViewData["Title"] = Model.Item.Id == Guid.Empty ? "添加房型" : "编辑房型";
}

<form method="post">
    <wx-input asp-hidden-1="Item.Id"
              asp-hidden-2="Item.HotelId" asp-hidden-3=Item.Quantity
              asp-for-1="Item.Name" asp-for-2="Item.PinYin" asp-for-3="Item.Quantity" asp-readonly-3=""
              asp-for-4=Item.IsDelete />
    <wx-buttons asp-link-text-1="保存" asp-link-type-1="EButtonType.Primary"
                asp-link-text-2="取消" asp-page-2="./Index" />
</form>


@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
    <script>
        var rn = $("#Item_Name");
        var py = $("#Item_PinYin")
        $(function () {
            rn.change(function () {
                $.get(`/api/PinYin/${rn.val()}`, function (ret) {
                    py.val(ret);
                });
            });
        });
    </script>
}
